import request from '@/utils/request'

// 查询仓库基础信息列表
export function listWarehouse(query) {
  return request({
    url: '/storage/warehouse/list',
    method: 'get',
    params: query
  })
}

// 查询仓库基础信息详细
export function getWarehouse(id) {
  return request({
    url: '/storage/warehouse/' + id,
    method: 'get'
  })
}

// 新增仓库基础信息
export function addWarehouse(data) {
  return request({
    url: '/storage/warehouse',
    method: 'post',
    data: data
  })
}

// 修改仓库基础信息
export function updateWarehouse(data) {
  return request({
    url: '/storage/warehouse',
    method: 'put',
    data: data
  })
}

// 删除仓库基础信息
export function delWarehouse(id) {
  return request({
    url: '/storage/warehouse/' + id,
    method: 'delete'
  })
}


//    根据仓库Id查询库区信息
export function getErpStorageArea(id) {
  return request({
    url: '/storage/warehouse/' + id+'/storage-areas',
    method: 'get'
  })
}


//    查询所有仓库信息及各仓库下的库区信息
export function getErpWarehouseAndArea() {
  return request({
    url: '/storage/warehouse'+ '/getErpWarehouseAndArea' ,
    method: 'get'
  })


}







